// vue.config.js
const {defineConfig} = require('@vue/cli-service')
module.exports = {
	transpileDependencies: true,
	// publicPath:process.env.NODE_ENV === 'production'?'./' : '/',
	publicPath:'./',  // 打包路径；使用相对路径
	outputDir:'dist',  // 输出文件目录
	productionSourceMap:false,   // 取消生成map文件
	lintOnSave:false,   // 配置关闭eslint
	parallel:false,    //  webpack-dev-serve  相关配置
	pages:{
		index:{
			entry:'src/main.js',
			template:'public/index.html',
			filename: 'index.html',
			title:'豫图网',
			chunks:['chunk-vendors','chunk-common', 'index']
		}
	},
	pluginOptions: {
		electronBuilder: {
			customFileProtocol:"./",  // 图标
			nodeIntegration: true,
			builderOptions: {
				appId:"com.ytw.ytw",
				asar: 'false',
				productName:"ytw",
				copyright:"copyright @ 2024",
				directories:{
					"output":"./dist"
				},
				win:{
					icon:"./public/icon.ico",
					"target":[{
						target:"nsis",
						arch:["x64"]  // "ia32"
					}],
					publish: [{
						provider: "generic",
						url:'https://ytw.hn8090kj.com/pc/' //更新包地址  
					}],
				},
				nsis: {
					oneClick: false,
					allowElevation:true,  // 允许请求提升
					allowToChangeInstallationDirectory: true, //自定义安装路径
					installerIcon:"./public/icon.ico", // 安装图标
					uninstallerIcon:"./public/icon.ico", //卸载图标
					installerHeaderIcon:"./public/icon.ico",// 安装时头部图标
					createDesktopShortcut:true, //创建桌面图标
					createStartMenuShortcut:true, //创建开始菜单图标
					shortcutName: 'ytw'
				}
			}
		},
	}
}